package com.project.class4_12.enumTest;

public class Test {
    public static void main(String[] args) {
//        WeekEnum w = WeekEnum.MON;
//        System.out.println(w);

//        SeasonEnum s = SeasonEnum.SPRING;
//        System.out.println(s.getName()+"   "+s.getColor());
//        SeasonEnum s1 = SeasonEnum.SUMMER;
//        System.out.println(s1.getName()+"   "+s1.getColor());
//
//        SeasonEnum s2 = SeasonEnum.AUTUMN;
//        s2.play();
//        System.out.println(s2);

        //得到枚举中所有的值列表
        SeasonEnum[] array = SeasonEnum.values();
        for(SeasonEnum s : array){
            System.out.println(s);
        }
    }
}

enum WeekEnum{
    MON,TUE,WED,THE,FRI,SAT,SUN
}

enum SeasonEnum{
    SPRING,SUMMER("夏天","红色"),AUTUMN("秋天","金黄色"),WINTER;
    private String name;
    private String color;

    public String getName() {
        return name;
    }


    public String getColor() {
        return color;
    }


    private SeasonEnum(){}

    private SeasonEnum(String name,String color){
        this.name = name;
        this.color = color;
    }

    public void play(){
        System.out.println("在"+this.color+"的"+this.name+"玩耍");
    }

    @Override
    public String toString() {
        return "SeasonEnum{" +
                "name='" + name + '\'' +
                ", color='" + color + '\'' +
                '}';
    }
}